-
Couldn't load subscription status.
- Fork 131
Add Elixir for Measurements.jl #2504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Elixir for Measurements.jl #2504
Conversation
Review checklistThis checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging. Purpose and scope
Code quality
Documentation
Testing
Performance
Verification
Created with ❤️ by the Trixi.jl community. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2504 +/- ##
=======================================
Coverage 96.68% 96.68%
=======================================
Files 511 511
Lines 42278 42278
=======================================
Hits 40875 40875
Misses 1403 1403
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Couldn't we also use the julia> l2, linf = analysis_callback(sol)
(l2 = Measurement{Float64}[0.0013 ± 0.018], linf = Measurement{Float64}[0.0044 ± 0.063])Edit: However, it seems like in the printed output of the Simulation running 'LinearScalarAdvectionEquation1D' with DGSEM(polydeg=3)
────────────────────────────────────────────────────────────────────────────────────────────────────
#timesteps: 27 run time: 5.50768890e-02 s
Δt: 4.16090622e-02 └── GC time: 2.47226840e-02 s (44.888%)
sim. time: 1.50000000e+00 (100.000%) time/DOF/rhs!: 3.57165381e-06 s
PID: 3.95505084e-06 s
#DOFs per field: 128 alloc'd memory: 198.639 MiB
#elements: 32
Variable: scalar
L2 error: 1.25768930e-03
Linf error: 4.42520451e-03
∑∂S/∂U ⋅ Uₜ : -3.90304695e-05
────────────────────────────────────────────────────────────────────────────────────────────────────I haven't looked into that, but maybe that's easy to fix given that the |
Yeah I also tried this, but I get some strange errors when turning this into the regular tests: elixir_advection_uncertainty.jl: Test Failed at /home/daniel/git/Trixi.jl/test/test_trixi.jl:71
Expression: isapprox(l2_expected, l2_actual, atol = 1.1102230246251565e-13, rtol = 1.4901161193847656e-8)
Evaluated: isapprox(0.0013 ± 0.018, 0.0013 ± 0.018; atol = 1.1102230246251565e-13, rtol = 1.4901161193847656e-8)
Stacktrace:
[1] macro expansion
@ ~/Software/julia-1.10.9/share/julia/stdlib/v1.10/Test/src/Test.jl:672 [inlined]
[2] macro expansion
@ ~/git/Trixi.jl/test/test_trixi.jl:71 [inlined]
[3] macro expansion
@ ~/git/Trixi.jl/test/test_tree_1d_advection.jl:174 [inlined]
[4] macro expansion
@ ~/Software/julia-1.10.9/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
[5] macro expansion
@ ~/git/Trixi.jl/test/test_tree_1d_advection.jl:174 [inlined]
[6] top-level scope
@ ~/git/Trixi.jl/test/test_trixi.jl:186
elixir_advection_uncertainty.jl: Test Failed at /home/daniel/git/Trixi.jl/test/test_trixi.jl:78
Expression: isapprox(linf_expected, linf_actual, atol = 1.1102230246251565e-13, rtol = 1.4901161193847656e-8)
Evaluated: isapprox(0.0044 ± 0.063, 0.0044 ± 0.063; atol = 1.1102230246251565e-13, rtol = 1.4901161193847656e-8)But maybe there is a workaround by checking the error lies e.g. in the specified bounds. |
|
Just to be sure, did you enter julia> l2, linf = analysis_callback(sol)
(l2 = Measurement{Float64}[0.0013 ± 0.018], linf = Measurement{Float64}[0.0044 ± 0.063])
julia> l2[1].val
0.0012576893000440965
julia> l2[1].err
0.017581020765034417
julia> linf[1].val
0.004425204509676317
julia> linf[1].err
0.0633672486044246 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Nice to see that the analysis_callback is now working in the tests!
Co-authored-by: Joshua Lampert <[email protected]>
Yeah that was the issue - I expected something like significant digits shenanigans here, but (in contrast to standard errors) indeed only rounded values where shown. |
|
We have the rate limiting issue again: https://github.com/trixi-framework/Trixi.jl/actions/runs/16600567477/job/46967562325?pr=2504#step:7:13587. We thought this was fixed by #2415, but the problem seems to be back. We saw the same also in TrixiShallowWater.jl this morning (after rerunning the tests, they succeeded again). Do you have any idea why this happens again, @vchuravy? Maybe something changed in the last days because we didn't have this issue for a while and today I saw four tests (one in TrixiShallowWater.jl, two in this PR, and one in #2505) failing because of this. |
13fd168
into
trixi-framework:main
No no clue. |
They disappeared again. So let's hope this was just a weird GitHub hiccup. |
https://trixi-framework.github.io/TrixiDocumentation/stable/tutorials/differentiable_programming/#Propagating-errors-using-Measurements.jl had never an accompanying elixir.